home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1980-01-03 | 1.2 KB | 50 lines |
- G4C
-
- ; ----- Obtaining feedback on mouse position and
- ; the colour of the pixel clicked on
-
- WinBig -1 -1 350 130 "MouseData.gc"
- WinType 11110001
- usetopaz
-
- BOX 0 0 0 0 OUT RIDGE
-
- ; ---- A box containing three cloured shapes
-
- BOX 40 30 270 80 IN RIDGE
- SQUARE 60 40 40 60 1 FILL
- CIRCLE 175 70 60 30 2 FILL
- SQUARE 250 40 40 60 3 FILL
-
- xonLoad
- GuiOpen MouseData.gc
-
- xonClose
- GuiQuit MouseData.gc
-
- ; ---- Headings above the box
- Text 140 2 100 12 'MouseData' 9 NOBOX
- Text 90 16 200 12 'Click within the box' 20 NOBOX
-
- ; ---- Text gadgets to contain feedback below the box
- Text 50 114 50 12 '' 6 NOBOX
- gadid 1
- Text 125 114 50 12 '' 6 NOBOX
- gadid 2
- Text 200 114 50 12 '' 10 NOBOX
- gadid 3
-
- ; ----- Marking the 'area' of the box serves two purposes :
- ; 1 Clicking within the area provides us with an 'event'
- ; to which a reaction can be coded
- ; 2 It restricts events and feedback to the area required.
- ; We read the values of $$MOUSE.WX, $$MOUSE.WY, and $$MOUSE.COLOR
- ; to obtain the required information.
-
- xArea 50 30 250 80 NONE
- update MouseData.gc 1 'X = $$MOUSE.WX'
- update MouseData.gc 2 'Y = $$MOUSE.WY'
- update MouseData.gc 3 'Colour = $$MOUSE.COLOR'
-
- ; X and Y can also be obtained as SCREEN coordinates , but here
- ; we read only the window coordinates.